import { http } from '@/utils/http'

// 列表接口
export const getNewsListAPI = () => {
  return http({
    // url: 'article_list',
    url:'getArticle',
    method: 'GET',
    urlType: 'kaiwu'
  })
}
//文章搜索  
export const articleSearchAPI= (data:any) => {
    return http({
      // url: 'article_list',
      url:'articleSearch',
      method: 'POST',
      header:{
        'Content-type': 'application/json',
      },
      data:data,
      urlType: 'kaiwu'
    })
  }

  //帖子搜索

  export const threadSearchAPI= (data:any) =>{
    return http({
        // url: 'article_list',
        url:'threadSearch',
        method: 'POST',
        header:{
          'Content-type': 'application/json',
        },
        data:data,
        urlType: 'kaiwu'
    })
  }


 //精彩学习
 export const getForumdisplayAPI= (data:any) => {
    return http({
      // url: 'article_list',
      url:`getForumdisplay&fid=4&page=${data.page}&orderby=${data.type}`,
      method: 'GET',
      data:data,
      urlType: 'kaiwu'
    })
  }
  //精彩学习详情
  export const getThreadDetailAPI= (data:any) => {
    return http({
      // url: 'article_list',
      url:`getThreadDetail&tid=${data.tid}`,
      method: 'GET',
      data:data,
      urlType: 'kaiwu'
    })
  }
//学习专区-获取根据分类ID获取数据
export const getPortalListAPI = (data: any) => {
    return http({
      url: `getPortalList&catid=${data.tid}&page=${data.page}`,
      method: 'GET',
      urlType: 'kaiwu'
    })
  }
// 详情接口
export const getNewsDetailAPI = (data: any) => {
  return http({
    url: `getArticleDetail&aid=${data.tid}`,
    method: 'GET',
    urlType: 'kaiwu'
  })
}
//获取学习列表接口
export const getStudyArticleAPI= () => {
    return http({
      url: `getStudyArticle`,
      method: 'GET',
      urlType: 'kaiwu'
    })
  }
// 测试img接口
export const imgAPI = (url: string) => {
  return http({
    url: `${url}`,
    method: 'GET',
    urlType: 'kaiwu'
  })
}
